import Mock from "mockjs";
let List = [];

export default {
  getStatisticalData: () => {
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          vivo: Mock.Random.float(100, 8000, 0, 0),
          苹果: Mock.Random.float(100, 8000, 0, 0),
          oppo: Mock.Random.float(100, 8000, 0, 0),
          三星: Mock.Random.float(100, 8000, 0, 0),
        })
      );
    }
    return {
      code: 200,
      data: {
        // 饼图
        videoData: [
          {
            name: "小米",
            value: 2999,
          },
          {
            name: "苹果",
            value: 5999,
          },
          {
            name: "vivo",
            value: 2799,
          },
          {
            name: "oppo",
            value: 3999,
          },
        ],
        // 柱状图
        userData: [
          {
            date: "周一",
            new: 5,
            active: 200,
          },
          {
            date: "周二",
            new: 10,
            active: 500,
          },
          {
            date: "周三",
            new: 12,
            active: 550,
          },
          {
            date: "周四",
            new: 60,
            active: 800,
          },
          {
            date: "周五",
            new: 61,
            active: 850,
          },
          {
            date: "周六",
            new: 65,
            active: 950,
          },
          {
            date: "周日",
            new: 69,
            active: 1000,
          },
        ],
        // 折线图
        orderData: {
          date: [
            "20191001",
            "20191002",
            "20191003",
            "20191004",
            "20191005",
            "20191006",
            "20191007",
          ],
          data: List,
        },
        // 表格数据
        tableData: [
          {
            name: "oppo",
            todayBuy: Mock.Random.float(100, 8000, 0, 0),
            monthBuy: Mock.Random.float(100, 8000, 0, 0),
            totalBuy: Mock.Random.float(100, 8000, 0, 0),
          },
          {
            name: "vivo",
            todayBuy: Mock.Random.float(100, 8000, 0, 0),
            monthBuy: Mock.Random.float(100, 8000, 0, 0),
            totalBuy: Mock.Random.float(100, 8000, 0, 0),
          },
          {
            name: "苹果",
            todayBuy: Mock.Random.float(100, 8000, 0, 0),
            monthBuy: Mock.Random.float(100, 8000, 0, 0),
            totalBuy: Mock.Random.float(100, 8000, 0, 0),
          },
          {
            name: "小米",
            todayBuy: Mock.Random.float(100, 8000, 0, 0),
            monthBuy: Mock.Random.float(100, 8000, 0, 0),
            totalBuy: Mock.Random.float(100, 8000, 0, 0),
          },
        ],
      },
    };
  },
};
